$(function() {
    $.ajax({
        url: '/user/queryUserMessage',
        success: function(res) {
            $('#phoneNumber').html(res.mobile)
            $('#account').html(res.username)
        }
    })
    $('#quit').on('tap', function(e) {
        mui.confirm('真的要退出吗', '确认退出', ['确认', '取消'], function(item) {
            if (item.index != 0) return
            $.ajax({
                url: ' /user/logout',
                success: function(res) {
                    if (res.success) {
                        mui.toast('成功退出');
                        setTimeout(function() {
                            window.location.href = 'login.html'
                        }, 500)
                        localStorage.clear('username', userName);
                        localStorage.clear('password', passWord);
                        $('.mui-badge').css('block', 'none')
                    }
                }
            })
        })

    })
})